import request from '@/utils/request'

// 查询消息推送列表
export function listPush(query) {
  return request({
    url: '/system/push/list',
    method: 'get',
    params: query
  })
}

// 查询消息推送详细
export function getPush(id) {
  return request({
    url: '/system/push/' + id,
    method: 'get'
  })
}

// 新增消息推送
export function addPush(data) {
  return request({
    url: '/system/push',
    method: 'post',
    data: data
  })
}

// 修改消息推送
export function updatePush(data) {
  return request({
    url: '/system/push',
    method: 'put',
    data: data
  })
}

// 删除消息推送
export function delPush(id) {
  return request({
    url: '/system/push/' + id,
    method: 'delete'
  })
}


//向所有会员推送消息
export function pushAll(data) {
  return request({
    url: '/websocket/pushAll',
    method: 'post',
    data: data
  })
}

//向指定会员推送消息
export function pushOne(data) {
  return request({
    url: '/websocket/pushOne',
    method: 'post',
    data: data
  })
}